<?php
	class DBConn {
		/* 本機測試*/
		private $conn = null;
		private $userName ="root";
	    private $password ="";
	    private $database = "shopcarda1";
	    private $host ="localhost:3306";
		//上版位置
//		private $userName = "shcard";
//		private $password = "asdfas32Ax";
//		private $database = "shcard";
//		private $host = "shcard.db.7086005.hostedresource.com";
	    
//	    private $userName = "shopcarda1";
//		private $password = "shopcarda1";
//		private $database = "shopcarda1";
//		private $host = "chien.myftp.org:3306";
		public function DBConn() {
			$this->open();
		}
		
		public function open() {
			$this ->conn = @mysql_connect($this->host, $this->userName ,$this->password);
			@mysql_query("SET NAMES utf8");
			@mysql_query("SET CHARACTER_SET_RESULTS= utf8", $this->conn);
			@mysql_select_db($this->database);	 
		}
		
		public function getConn(){
			return $this ->conn;
		}
		
		public function close() {
			@mysql_close(conn);
		}
	}
?>